#ifndef PLAY_H
#define PLAY_H

#include <QWidget>
#include"snack.h"
#include<QTimer>
#include<QRect>
enum direction_snack
{
    UP,
    DOWN,
    LEFT,
    RIGHT
};

class play : public QWidget
{
    Q_OBJECT
public:
    explicit play(QWidget *parent = nullptr);

        void paintEvent(QPaintEvent *event);

        direction_snack direction_current;

        snack my_snack;

        //设置定时器
        QTimer *my_timer;
        //食物
        QRect  food_snack;
        void creat_food();
        int count=0;
        bool game_over_check();



signals:

};

#endif // PLAY_H
